/*
 * @Author: Xia_cc 978487464@qq.com
 * @Date: 2022-08-11 12:46:35
 * @LastEditors: Xia_cc 978487464@qq.com
 * @LastEditTime: 2022-08-11 16:36:18
 * @FilePath: \bpm-management-system\src\component\organizationmanage\Gangwei\Gangwei-change.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// import React, { Component } from 'react'
import { Form, Input, message,Tree } from 'antd';
import React from 'react';
import "./GangweiChange.css"

const JobNameInput = () => {
  const [form] = Form.useForm();
  //输入框
  const onFinish = () => {
    message.success('Submit success!');
  };

  const onFinishFailed = () => {
    message.error('Submit failed!');
  };
  //树形
  const onSelect = (selectedKeys, info) => {
    console.log('selected', selectedKeys, info);
  };

  const onCheck = (checkedKeys, info) => {
    console.log('onCheck', checkedKeys, info);
  };

  const treeData = [
    {
      title: '首页',
      key: '0-0',
      children: [
        {
          title: '监控台',
          key: '0-0-1',
          disabled: false,
        },{
          title: '任务台',
          key: '0-0-2',
          // disabled: true,
        },{
          title: '工作台',
          key: '0-0-3',
          // disabled: true,
        },
        
      ],
    },{
      title: '审批管理',
      key: '0-1',
      children: [
        {
          title: '班组付款申请审批',
          key: '0-1-1',
          disabled: false,
        },{
          title: '材料采购申请审批',
          key: '0-1-2',
          // disabled: true,
        },{
          title: '临时付款申请审批',
          key: '0-1-3',
          // disabled: true,
        },{
          title: '用章付款申请审批',
          key: '0-1-4',
          disabled: false,
        },{
          title: '选样申请审批',
          key: '0-1-5',
          // disabled: true,
        },{
          title: '联系单签发申请审批',
          key: '0-1-6',
          // disabled: true,
        },{
          title: '材料采购申请审批',
          key: '0-1-7',
          disabled: false,
        },{
          title: '劳务申请审批',
          key: '0-1-8',
          // disabled: true,
        }
        
      ],
    },
  ];

  return (
    <>
    <Form
      form={form}
      layout="vertical"
      onFinish={onFinish}
      onFinishFailed={onFinishFailed}
      autoComplete="off"
    >
      <Form.Item
        name="url"
        label="岗位名称"
        rules={[
          {
            required: true,
          },
          {
            type: 'url',
            warningOnly: true,
          },
          {
            type: 'string',
            min: 6,
          },
        ]}
      >
        <Input className='jobName' placeholder="请输入岗位名称" />
      </Form.Item>
      
    </Form>
    <Form
      form={form}
      layout="vertical"
      onFinish={onFinish}
      onFinishFailed={onFinishFailed}
      autoComplete="off"
    >
      <Form.Item
        name="url"
        label="权限管理"
        rules={[
          {
            required: true,
          },
          {
            type: 'url',
            warningOnly: true,
          },
          {
            type: 'string',
            min: 6,
          },
        ]}
      >
        
      </Form.Item>
    </Form>
    <Tree
      checkable
      defaultExpandedKeys={['0-0-0', '0-0-1']}
      defaultSelectedKeys={['0-0-0', '0-0-1']}
      defaultCheckedKeys={['0-0-0', '0-0-1']}
      onSelect={onSelect}
      onCheck={onCheck}
      treeData={treeData}
      className="treeRoot"
    />
    </>
  );
};

export default JobNameInput;